<{include file="public/header.html"}>
<header class="title title-border-sm bj-white">
    <a href="javascript:history.back(-1)" class="icon-return iconfont title-left title-top col-red">&#xe604;</a>
    <h1 class="text-center name">任务申诉</h1>
</header>
<div class="security <{$appeal_info['status']}>">
    <ul class="plr15">
        <input type="hidden" name="sid" id="tsidval" value="<{$sid}>">
        <input type="hidden" name="scid" id="tcidval" value="<{$cid}>">
        <{if $appeal_info['status'] > 0 }>
            <li class="border-bottom-sm">
                <a href="javascript:;" class="f-cb plr15 data_item">
                    <p>（==<{$appeal_info['status_val']}>==）</p>
                </a>
            </li>
        <{else}>
            <div class="input-group">
                <textarea id="content_word" name="content_word" placeholder="填写申诉信息"><{$signature}></textarea>
            </div>
            <button class="btn mt30 bj-red" onclick="appeal_sub();">提交</button>
            <{if $comm_info}>
                <button class="btn mt30 bj-blue" id="type_on">取消申诉</button>
            <{/if}>
        <{/if}>
        <{if $comm_info && $appeal_info['status']==1}>
            <button class="btn mt30 bj-red" onclick="adopt_sub(3);">申请客服介入</button>
        <{/if}>
    </ul>
    <{if $comm_info}>
    <div class="wenda-page mt50">
        <div class="wenda-con">
        <div class="wenda-ul disblock">
            <ul class="ask" style="border-top: 6px solid #eee;">
                <{foreach from=$comm_info item=val}>
                <li>
                    <p><{$val['content_word']}></p>
                    <div class="con">
                        <font class="iconfont ml5"><span style="color: #865">发布人：</span><span><{$val['username']}></span></font>
                        <font class="iconfont ml5"><span style="color: #865">发布时间：</span><span><{$val['add_time']}></span></font>
                    </div>
                </li>
                <{/foreach}>
            </ul>
        </div>
        </div>
    </div>
        <{/if}>
</div>
<div class="public-field-bj publick-jq2" id="alert_mes" >
    <div class="public-field-phone w100" id="alert_mes_cont" style="bottom: 5px;">
        <div class="plr15">
            <ul class="bj-white">
                <li data-type="0">确认取消申诉吗？</li>
            </ul>
            <button class="btn bj-white mt5" onclick="adopt_sub(1);" style="border-radius: 12px;width: 49%;color:#d70e0e">确认</button>
            <button class="btn bj-white mt5 close-jq _close" style="border-radius: 12px;width: 49%;">取消</button>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#type_on").click(function () {
        $("#alert_mes").stop().fadeIn();
    });
    $("#alert_mes").click(function () {
        $("#alert_mes").stop().fadeOut();
    });
    function appeal_sub() {
        if (!_is_login()) {
            $.mvalidateTip("请先登录");
            setTimeout(function () {
                window.location.href = "/account/login.html";
            }, 1500);
        }
        var tsid = $("#tsidval").val();
        var content_word = $("#content_word").val();
        $.ajax({
            type: 'POST',
            url: '/user/ajax_appealsub.html',//发送请求
            data: {tsid: tsid, content_word: content_word},
            dataType: "json",
            success: function (result) {
                $.mvalidateTip(result.meg);
                setTimeout(function () {
                    location.reload();
                }, 1500);
            }
        });

    }
    function adopt_sub(type, status) {
        var tsid = $("#tsidval").val();
        var tscid = $("#tcidval").val();
        if (type == 1) {
            $.ajax({
                type: 'POST',
                url: '/user/ajax_cancelappeal.html',//发送请求
                data: {tsid: tsid, tscid: tscid},
                dataType: "json",
                success: function (result) {
                    $.mvalidateTip(result.meg);
                    setTimeout(function () {
                        location.href = "/account/taskrec.html";
                    }, 1500);

                }
            });
        }

        if (type == 3) {
            $.ajax({
                type: 'POST',
                url: '/user/ajax_taskkefu.html',//发送请求
                data: {tscid: tscid},
                dataType: "json",
                success: function (result) {
                    $.mvalidateTip(result.meg);
                    setTimeout(function () {
                        location.href = "/account/taskrec.html";
                    }, 1500);
                }
            });
        }
    }

</script>
<{include file="public/footer.html"}> 